package com.winning.sjzc.common.controller;

import java.util.HashMap;
import java.util.Map;

/**
 * description:
 *
 * @author yanxf@winning.com.cn
 * @date 2019/08/13 16:47
 */
public abstract class BaseController {

  /**
   * 成功返回格式
   * @param value
   * @param repData
   * @return
   */
  public static Map<String,Object> successObjectResult(Object value,Object repData) {
    Map<String, Object> result = new HashMap<>(3);
    result.put("statusCode", 200);
    result.put("repData",repData);
    result.put("repMsg", value);
    return result;
  }


  /**
   * 失败返回格式
   * @param repMsg
   * @param code
   * @return
   */
  public static Map<String,Object> baseError(String repMsg,int code) {
    Map<String, Object> result = new HashMap<>(3);
    result.put("statusCode", code);
    result.put("repMsg", repMsg);
    result.put("repData","");
    return result;
  }

}
